#ifndef KWDB_SDK_TRANSPORT_H
#define KWDB_SDK_TRANSPORT_H

#include "kwdb/point.h"
#include "kwdb/status.h"
#include "ingest.pb.h"
#include "ingest.grpc.pb.h"
#include <grpcpp/grpcpp.h>
#include <chrono>

namespace kwdb {
namespace transport {

/**
 * @brief Convert std::chrono time_point to Unix nanoseconds
 */
int64_t to_unix_ns(const std::chrono::system_clock::time_point& tp);

/**
 * @brief Convert SDK Point to protobuf Point
 */
void convert_point(const kwdb::Point& src, kwdb::ingest::v1::Point* dst);

/**
 * @brief Convert gRPC Status to SDK Status
 */
Status grpc_status_to_sdk_status(const grpc::Status& grpc_status);

} // namespace transport
} // namespace kwdb

#endif // KWDB_SDK_TRANSPORT_H